﻿using GC_FFW.BusinessEntities.Abstractions.Interfaces.Forecast;

namespace GC_FFW.BusinessEntities.Forecast
{
	public class Coefficient : ICoefficient
	{
		#region ICoefficient Members

		public double FirstCoefficient { get; set; }

		public double SecondCoefficient { get; set; }

		public bool IsEqualCoefficients
		{
			get
			{
				return FirstCoefficient.Equals(SecondCoefficient);
			}
		}

		public double Min
		{
			get
			{
				return FirstCoefficient < SecondCoefficient
					? FirstCoefficient
					: SecondCoefficient;
			}
		}

		public double Max
		{
			get
			{
				return FirstCoefficient > SecondCoefficient
					? FirstCoefficient
					: SecondCoefficient;
			}
		}

		#endregion

		#region ICloneable Members

		public object Clone()
		{
			return new Coefficient
			{
				FirstCoefficient = FirstCoefficient,
				SecondCoefficient = SecondCoefficient
			};
		}

		#endregion
	}
}
